{include file='public:header-css'/}
<body>
<div class="lyear-layout-web">
    <div class="lyear-layout-container">
        <!--左侧导航-->
        {include file='public:left-menu'/}
        <!--End 左侧导航-->
        <!--头部信息-->
        {include file='public:nav-header' title="会员管理" subTitle="会员充值"/}
        <!--End 头部信息-->

        <!--页面主要内容-->
        <main class="lyear-layout-content">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="card">
                            <div class="card-toolbar">
                                <div class="card-toolbar-center">
                                    <a href="" class="table-btn btn-dark"><i class="mdi mdi-replay"></i></a>
                                    <button class="table-btn btn-theme">共{$list->total()}条记录 当前第{$list->currentPage()}页</button>
                                </div>
                                <form class="table-form" method="post" action="">
                                    <div class="table-form-group">
                                        <input data-type="time" readonly id="start_time" name="start_time" type="text" value="{$start_time}">
                                        <button class="btn btn-default" type="button">开始时间</button>
                                    </div>
                                    <div class="table-form-group">
                                        <input data-type="time" name="end_time" id="end_time" type="text" value="{$end_time}" readonly>
                                        <button class="btn btn-default" type="button">结束时间</button>
                                    </div>
                                    <div class="table-form-group">
                                        <select name="order_status" class="input-group-select">
                                            <option value="">充值状态</option>
                                            <option value="-1" {if $Request.param.order_status=='-1'}selected{/if}>待支付</option>
                                            <option value="1" {if $Request.param.order_status=='1'}selected{/if}>已支付</option>
                                            <option value="2" {if $Request.param.order_status=='2'}selected{/if}>已取消</option>
                                        </select>
                                        <input type="text" value="{$Request.param.keyword}" name="keyword" placeholder="查询会员手机号">
                                        <button class="btn btn-default" type="submit">搜索</button>
                                    </div>
                                </form>
                            </div>
                            <div class="card-body">
                                <div class="table-responsive">
                                    <table class="table table-bordered table-striped table-hover">
                                        <thead>
                                        <tr>
                                            <th>编号</th>
                                            <th>手机号码</th>
                                            <th>充值方式</th>
                                            <th>充值金额</th>
                                            <th>充值状态</th>
                                            <th>创建时间</th>
                                            <th>支付时间</th>
                                            <th>取消时间</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        {if $list->isEmpty()}
                                        <tr>
                                            <td class="no-data" colspan="50">
                                                <i class="mdi mdi-alert-decagram"></i>没有符合条件的记录
                                            </td>
                                        </tr>
                                        {else/}
                                        {volist name="$list" id="vo"}
                                        <tr>
                                            <td>{$vo[$vo.pk]}</td>
                                            <td><a href="{:url('User/detail',['user_id'=>$vo.user_id])}">{$vo.user.mobile}</a></td>
                                            <td>{$vo.type_text}</td>
                                            <td class="text-red">{$vo.order_amount}</td>
                                            <td>{$vo.status_text}</td>
                                            <td>{$vo.add_time}</td>
                                            <td>{$vo.pay_time_text}</td>
                                            <td>{$vo.cancel_time_text}</td>
                                        </tr>
                                        {/volist}
                                        {/if}
                                        </tbody>
                                    </table>
                                </div>
                                <!--分页-->
                                <div class="page">
                                    {$page|raw}
                                </div>
                            </div>
                        </div>
                    </div>

                </div>

            </div>

        </main>
        <!--End 页面主要内容-->
    </div>
</div>
<!--日期选择插件-->
<script src="__STATIC__/plugin/laydate/laydate/laydate.js"></script>
<script type="text/javascript">
    $(function(){
        layer.photos({
            photos: '.img'
            ,anim: 5
        });
        $('#start_time').layDate();
        $('#end_time').layDate();
    });
    function handel(type) {
        var checkbox = $('.checkbox:checked');
        if (checkbox.length == 0) {
            showErrorMsg("请选择数据");
            return
        }
        var ids = [];
        $.each(checkbox, function (index, item) {
            ids.push(item.value)
        });
        var text = "已审核通过或失败的充值不会再次处理,确认操作?";
        showConfirm(text, function () {
            var url = "{:url('User/recharge_update')}";
            var data = {'ids': ids, 'type': type};
            public_ajax(url, data, function (res) {
                if (res.code==1){
                    showSuccessMsg(res.msg,function () {
                        location.reload()
                    })
                }else {
                    showErrorMsg(res.msg);
                }
            })
        })
    }
</script>
</body>
</html>
